package com.celeritymq.message;

import javax.jms.Destination;
import javax.jms.JMSException;
import javax.jms.TextMessage;

public class CelerityTextMessage extends CelerityMessage implements TextMessage {
	protected CelerityTextMessage(String text, String messageId, String correlationID, Destination destination, int priority,
			int deliveryMode, long expirationTime) {
		super(messageId, correlationID, destination, priority, deliveryMode, expirationTime);
		this.text = text;
	}

	private String text;

	@Override
	public String getText() throws JMSException {
		return text;
	}

	@Override
	public void setText(String text) throws JMSException {
		this.text = text;
	}

	@Override
	public void clearBody() throws JMSException {
		text = "";
	}

}
